<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen-unsupported: Eigen::Tensor&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen-unsupported</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classEigen_1_1Tensor.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="classEigen_1_1Tensor-members.html">List of all members</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Eigen::Tensor&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__CXX11__Tensor__Module.html">Tensor Module</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Scalar_, int NumIndices_, int Options_, typename IndexType_&gt;<br />
class Eigen::Tensor&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt;</h3>

<p>The tensor class. </p>
<p>The Tensor class is the work-horse for all <em>dense</em> tensors within <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library.">Eigen</a>.</p>
<p>The Tensor class encompasses only dynamic-size objects so far.</p>
<p>The first two template parameters are required: </p><dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Scalar_</td><td>Numeric type, e.g. float, double, int or <code>std::complex&lt;float&gt;</code>. User defined scalar types are supported as well (see <a class="elRef" href="../TopicCustomizing_CustomScalar.html#user_defined_scalars">here</a>). </td></tr>
    <tr><td class="paramname">NumIndices_</td><td>Number of indices (i.e. rank of the tensor)</td></tr>
  </table>
  </dd>
</dl>
<p>The remaining template parameters are optional &ndash; in most cases you don't have to worry about them. </p><dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Options_</td><td>A combination of either <b><a class="elRef" href="../group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a77c993a8d9f6efe5c1159fb2ab07dd4f">RowMajor</a></b> or <b><a class="elRef" href="../group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a0103672ae41005ab03b4176c765afd62">ColMajor</a></b>, and of either <b><a class="elRef" href="../group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13ad0e7f67d40bcde3d41c12849b16ce6ea">AutoAlign</a></b> or <b><a class="elRef" href="../group__enums.html#ggaacded1a18ae58b0f554751f6cdf9eb13a56908522e51443a0aa0567f879c2e78a">DontAlign</a></b>. The former controls <a class="elRef" href="../group__TopicStorageOrders.html">storage order</a>, and defaults to column-major. The latter controls alignment, which is required for vectorization. It defaults to aligning tensors. Note that tensors currently do not support any operations that profit from vectorization. Support for such operations (i.e. adding two tensors etc.) is planned.</td></tr>
  </table>
  </dd>
</dl>
<p>You can access elements of tensors using normal subscripting:</p>
<div class="fragment"><div class="line"><a class="code" href="classEigen_1_1Tensor.html">Eigen::Tensor&lt;double, 4&gt;</a> t(10, 10, 10, 10);</div>
<div class="line">t(0, 1, 2, 3) = 42.0;</div>
<div class="ttc" id="aclassEigen_1_1Tensor_html"><div class="ttname"><a href="classEigen_1_1Tensor.html">Eigen::Tensor</a></div><div class="ttdoc">The tensor class.</div><div class="ttdef"><b>Definition:</b> Tensor.h:67</div></div>
</div><!-- fragment --><p>This class can be extended with the help of the plugin mechanism described on the page <a class="elRef" href="../TopicCustomizing_Plugins.html">Extending MatrixBase (and other classes)</a> by defining the preprocessor symbol <code>EIGEN_TENSOR_PLUGIN</code>, <code>EIGEN_TENSORBASE_PLUGIN</code>, and <code>EIGEN_READONLY_TENSORBASE_PLUGIN</code>.</p>
<p><em><b>Some notes:</b></em></p>
<dl>
<dt><b>Relation to other parts of <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library.">Eigen</a>:</b> </dt>
<dd>The midterm development goal for this class is to have a similar hierarchy as <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library.">Eigen</a> uses for matrices, so that taking blocks or using tensors in expressions is easily possible, including an interface with the vector/matrix code by providing .asMatrix() and .asVector() (or similar) methods for rank 2 and 1 tensors. However, currently, the Tensor class does not provide any of these features and is only available as a stand-alone class that just allows for coefficient access. Also, when fixed-size tensors are implemented, the number of template arguments is likely to change dramatically. </dd>
</dl>
<p><a class="elRef" href="../group__TopicStorageOrders.html">Storage orders</a> </p>
</div><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for Eigen::Tensor&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt;:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classEigen_1_1Tensor__inherit__graph.png" border="0" usemap="#aEigen_1_1Tensor_3_01Scalar___00_01NumIndices___00_01Options___00_01IndexType___01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="aEigen_1_1Tensor_3_01Scalar___00_01NumIndices___00_01Options___00_01IndexType___01_4_inherit__map" id="aEigen_1_1Tensor_3_01Scalar___00_01NumIndices___00_01Options___00_01IndexType___01_4_inherit__map">
<area shape="rect" title="The tensor class." alt="" coords="21,160,188,487"/>
<area shape="rect" href="classEigen_1_1TensorBase.html" title=" " alt="" coords="5,5,204,112"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ade5949755478e59ad152dd952d6a8636"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tensor.html#ade5949755478e59ad152dd952d6a8636">resize</a> (const array&lt; Index, NumIndices &gt; &amp;dimensions)</td></tr>
<tr class="separator:ade5949755478e59ad152dd952d6a8636"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa587c5805fcce5d35bb29e56a96bd02e"><td class="memTemplParams" colspan="2">template&lt;typename CustomDimension &gt; </td></tr>
<tr class="memitem:aa587c5805fcce5d35bb29e56a96bd02e"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tensor.html#aa587c5805fcce5d35bb29e56a96bd02e">resize</a> (CustomDimension &amp;dimensions)</td></tr>
<tr class="separator:aa587c5805fcce5d35bb29e56a96bd02e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d0f7b1474af9b4e76cb4e544c2bb03c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1Tensor.html#a9d0f7b1474af9b4e76cb4e544c2bb03c">Tensor</a> (const array&lt; Index, NumIndices &gt; &amp;dimensions)</td></tr>
<tr class="separator:a9d0f7b1474af9b4e76cb4e544c2bb03c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a9d0f7b1474af9b4e76cb4e544c2bb03c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d0f7b1474af9b4e76cb4e544c2bb03c">&#9670;&nbsp;</a></span>Tensor()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Scalar_ , int NumIndices_, int Options_, typename IndexType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classEigen_1_1Tensor.html">Eigen::Tensor</a>&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt;::<a class="el" href="classEigen_1_1Tensor.html">Tensor</a> </td>
          <td>(</td>
          <td class="paramtype">const array&lt; Index, NumIndices &gt; &amp;&#160;</td>
          <td class="paramname"><em>dimensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Normal Dimension </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ade5949755478e59ad152dd952d6a8636"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade5949755478e59ad152dd952d6a8636">&#9670;&nbsp;</a></span>resize() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Scalar_ , int NumIndices_, int Options_, typename IndexType_ &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1Tensor.html">Eigen::Tensor</a>&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt;::resize </td>
          <td>(</td>
          <td class="paramtype">const array&lt; Index, NumIndices &gt; &amp;&#160;</td>
          <td class="paramname"><em>dimensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Normal Dimension </p>

</div>
</div>
<a id="aa587c5805fcce5d35bb29e56a96bd02e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa587c5805fcce5d35bb29e56a96bd02e">&#9670;&nbsp;</a></span>resize() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Scalar_ , int NumIndices_, int Options_, typename IndexType_ &gt; </div>
<div class="memtemplate">
template&lt;typename CustomDimension &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classEigen_1_1Tensor.html">Eigen::Tensor</a>&lt; Scalar_, NumIndices_, Options_, IndexType_ &gt;::resize </td>
          <td>(</td>
          <td class="paramtype">CustomDimension &amp;&#160;</td>
          <td class="paramname"><em>dimensions</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Custom Dimension </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Tensor_8h_source.html">Tensor.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="classEigen_1_1Tensor.html">Tensor</a></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:08:00 for Eigen-unsupported by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
